#include "Physics.h"


Physics::Physics(D3DXVECTOR2 p):IComponent(PHYSICS)
{
	this->_pos = p;
}


Physics::~Physics(void)
{
}

void Physics::init()
{
	_v.x = 0;
	_v.y = 0;
}

void Physics::update()
{
	move();
}

void Physics::move()
{
	_pos += _v;
	if(_pos.y > GROUND)
	{
		_pos.y += G;
	}
}

D3DXVECTOR2 Physics::getPosition()
{
	return _pos;
}

void Physics::setV(float vx,float vy)
{
	_v.x = vx;
	_v.y = vy;
}

void Physics::setPosition(D3DXVECTOR2 p)
{
	_pos = p;
}
